XtGem Forum catalog

Wellcome to nimbuzz4all.waphall.com

mr.sajaniya



HTML css tutorial







when a browser reads a style sheet, it will format the document according to it. There are three ways of inserting style sheet:




External style sheet :



an external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of entire web site by changing one file. Each page must link to the style sheet using the <link> tag. the <link> tag goes inside the head section.

Example:

<head><link rel="stylesheet" type="text/css" href="http://nimbuzz4all.waphall.com/style.css"/></head>



An external style sheet can be written in any text editor. The file should not contains any HTML tags. Your style sheet should be saved with a ".css" extension. an example of a style sheet file is shown below:


hr { color: siena} p { margin-left: 20px} body { background-image: url("http://nimbuzz4all.waphall.com/logo.gif")}




[NOTE]: do not leave spaces between the properly value and the units ; if you use "margin-left: 20 px" instead of "margin-left: 20px" it will only work properly in IE6 but it will not work in Mozilla/Firefox or Netscape.




Internal style sheet



An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section by using the <style> tag, like this:

Example:

<head><style type="text/css"> hr { color: sienna } p { margin-left: 20px } body { background-image: url("http://nimbuzz4all.waphall.c6/logo.gif")}</style></head>



[NOTE]: A browser normally ignore unkn0wn tags. this means that an old browser that does not support styles, will ignore the <style> tag, but the content of the <style> tag will be the content of the <style> tag will be displayed on the page. it is possible to prevent an old browser from displaying the content by hiding it in the HTML comment element :



<head><style type="text/css"<!--hr { color: sienna } p { margin-left: 20px } body { background-image: url("http://nimbuzz4all.waphall.com")}--></style></head>




Multiple style sheet



It some properties have been set for the same selector in different style sheets, the value will be inherited from the more specific style sheet.



For example, an externa style sheet has these properties for the h3 selectors:



h3 { color: red; text-align: left; font-size: 8pt }



And an internal style sheet has these properties for the h3 selector:



h3 { text-align: right; font-size: 20pt }</font>



if the page with the internal style sheet also links to the external style sheet the properties for h3 will be:



color: red; text-align: right; font-size: 20pt




Home

posted by mr.sajaniya